<%@ page contentType="text/html;charset=UTF-8" trimDirectiveWhitespaces="true"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<c:set var="extLibs" value="validate,grid"/>
<sys:header title="福利发放管理 - 节日福利" extLibs="${extLibs}"/>
<div class="portlet box ${boxStyleColor} autoHeight">
	<div class="portlet-title">
		<div class="caption"><i class="fa fa-coffee"></i>${malWelfareDis.isNewRecord ? '新增' : '编辑'}节日福利</div>
		<%-- <div class="actions">
			<shiro:hasPermission name="mal:malWelfareDis:edit">
				<a href="#" class="btn btn-default btn-sm" onclick="$('#btnSubmit').click();return false;"><i class="fa fa-check"></i> 保 存</a>
			</shiro:hasPermission>
			<a href="#" class="btn btn-default btn-sm" onclick="$('#btnCancel').click();return false;"><i class="fa fa-reply-all"></i> 关 闭</a>
		</div> --%>
	</div>
	<div class="portlet-body form">
		<form:form id="inputForm" modelAttribute="malWelfareDis" action="${ctx}/mal/malWelfareDis/save" method="post" class="form-horizontal">
			<div class="form-body">
				<h4 class="form-section">基本信息</h4>
				<form:hidden path="id"/>
				<div class="row">
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								节日标题：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<form:hidden path="festivalTitle"/>
								<form:select path="festivalId" multiple="false" cssClass="form-control" class="form-control  input-sm" onchange="">
									<form:options items="${malFestivalWelfareList}"  itemLabel="festival" itemValue="id" htmlEscape="false"></form:options>
								</form:select>
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								套餐：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<form:hidden path="setMealName"/>
								<form:select path="setMealId" multiple="false" cssClass="form-control" class="form-control  input-sm" onchange="">
									<form:options items="${malSetMealList}"  itemLabel="name" itemValue="id" htmlEscape="false"></form:options>
								</form:select>
							</div>
						</div>

					</div>
					<%--<div class="col-xs-6">--%>
						<%--<div class="form-group" >--%>
							<%--<a style="color: red" onclick="addtab()">查看福利详细介绍</a>--%>
						<%--</div>--%>
					<%--</div>--%>
				</div>
				<div class="row">
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								所在校区：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<form:select path="campus" multiple="false" class="form-control required input-sm"  >
									<form:options items="${fns:getDictList('campus')}" itemLabel="name" itemValue="name" htmlEscape="false"/>
								</form:select>
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								发放地点：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<form:select path="place" multiple="false" class="form-control required input-sm"  >
									<form:options items="${fns:getDictList('place')}" itemLabel="name" itemValue="name" htmlEscape="false"/>
								</form:select>
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								会员名称：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<form:hidden path="memberCode"/>
								<form:input path="memberName" htmlEscape="false" maxlength="64" class="form-control" readonly="true"/>
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								单位名称：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<form:hidden path="office.officeCode"/>
								<form:input path="officeName" htmlEscape="false" maxlength="64" class="form-control" readonly="true"/>
							</div>
						</div>
					</div>
				</div>

			</div>
			<div class="form-actions fluid">
				<div class="row">
					<div class="col-xs-12">
						<div class="col-sm-offset-2 col-sm-10">
							<shiro:hasPermission name="mal:malWelfareDis:edit">
								<button id="btnSubmit" type="submit" class="btn btn-primary"><i class="fa fa-check"></i> 保 存</button>&nbsp;
							</shiro:hasPermission>
							<button id="btnCancel" type="button" class="btn default" onclick="closeCurrentTabPage('${param.parentTabPageId}')"><i class="fa fa-reply-all"></i> 关 闭</button>
						</div>
					</div>
				</div>
			</div>
		</form:form>
	</div>
</div>
<sys:footer extLibs="${extLibs}"/>
<script type="text/javascript">
	$("#inputForm").validate({
		submitHandler: function(form){
			$("#setMealName").val($("#setMealId").select2("data").text);
			$("#festivalTitle").val($("#festivalId").select2("data").text);
			ajaxSubmitForm($(form), function(data){
				showMessage(data.message);
				if(data.result == Global.TRUE){
					closeCurrentTabPage('${param.parentTabPageId}', function(contents, contentWindow){
						contentWindow.page();
					});
				}
			}, "json");
	    }
	});

	$(document).ready(function(){
		if('${setMealId}'!=null){
			$("#setMealId").val('${setMealId}');
			$("#setMealName").val('${setMealName}');
		}
	})

    function addtab(){
        var url="${ctx}/mal/malSetMeal/setMealList";
        addTabPage($(this),"查看套餐",url,null,null,true);
    };
</script>